﻿<BaseControl:DialogControl x:Class="jSLApp.Client.Forms.UserAbout"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:BaseControl="clr-namespace:jSLCore.Client.Presentation.BaseControl;assembly=jSLCore.Client.Presentation" 
                           xmlns:j="clr-namespace:jSLCore.Client.Presentation.Controls;assembly=jSLCore.Client.Presentation"
                           xmlns:jBinding="clr-namespace:jSLCore.Client.Presentation.jBinding;assembly=jSLCore.Client.Presentation" xmlns:local="clr-namespace:jSLApp.Client.Controls" xmlns:Converters="clr-namespace:jSLApp.Client.Converters" xmlns:Security="clr-namespace:jSLApp.Client.Security" xmlns:Forms="clr-namespace:jSLApp.Client.Forms" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <ScrollViewer HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Auto" BorderThickness="0">
        <StackPanel Orientation="Vertical">
        <j:LeftHeaderContainer Header="Логин:">
            <BaseControl:BaseControl.jBinding>
                <Security:SecurityBinding Permission="Users"/>
            </BaseControl:BaseControl.jBinding>
            <HyperlinkButton Content="{Binding LoginTxt}" Click="goto_userAdmin"/>
        </j:LeftHeaderContainer>
        <j:LeftHeaderContainer Header="Псевдоним:">
            <HyperlinkButton Content="{Binding NameText}" Click="changeName_Clicked">
                <BaseControl:BaseControl.jBinding>
                    <Converters:IsAuthorizedAuthorBinding ElementPropertyPath="Cursor" Path="Login">
                        <Converters:TrueToHandConverter>
                            <Converters:AuthorIsCurrentUserConverter AllowModerators="False"/>
                        </Converters:TrueToHandConverter>
                    </Converters:IsAuthorizedAuthorBinding>
                </BaseControl:BaseControl.jBinding>
            </HyperlinkButton>
        </j:LeftHeaderContainer>
        <j:LeftHeaderContainer Header="Дата регистрации:">
            <BaseControl:BaseControl.jBinding>
                <Security:SecurityBinding/>
            </BaseControl:BaseControl.jBinding>
            <TextBlock>
                <TextBlock.Text>
                    <jBinding:jBinding Path="CreationDate" ConvertingMode="ToShortDate"/>
                </TextBlock.Text>
            </TextBlock>
        </j:LeftHeaderContainer>
        <Image Width="150" Height="150" 
               HorizontalAlignment="Left" 
               Cursor="Hand"                
               Name="pic"  
               MouseLeftButtonDown="changePic_Clicked">
            <BaseControl:BaseControl.jBinding>
                <Converters:IsAuthorizedAuthorBinding ElementPropertyPath="Cursor" Path="Login">
                    <Converters:TrueToHandConverter>
                        <Converters:AuthorIsCurrentUserConverter AllowModerators="False"/>
                    </Converters:TrueToHandConverter>
                </Converters:IsAuthorizedAuthorBinding>
            </BaseControl:BaseControl.jBinding>
        </Image>        
        <j:ImageGroupBox Header="Настройки">
            <BaseControl:BaseControl.jBinding>
                <Converters:IsAuthorizedAuthorBinding Path="Login">                    
                        <Converters:AuthorIsCurrentUserConverter AllowModerators="False"/>                    
                </Converters:IsAuthorizedAuthorBinding>
            </BaseControl:BaseControl.jBinding>
            <StackPanel Orientation="Vertical">
                <CheckBox Name="newsCheck" Content="Уведомлять о новостях портала" Click="mail_Clicked" IsChecked="{Binding MailingNews}"/>
                <CheckBox Name="messageCheck" Content="Уведомлять о новых сообщениях" Click="mail_Clicked" IsChecked="{Binding MailingInbox}"/>
                <CheckBox Name="commentCheck" Content="Уведомлять о комментариях к музыке" Click="mail_Clicked" IsChecked="{Binding MailingComments}"/>
                <CheckBox Name="chatCheck" Content="Не показывать всплавающее окно чата" Click="chat_Clicked" IsChecked="{Binding dontShowChat}"/>
                <j:HelpBox Text="Имя и картинку можно сменить, нажав на них."/>
                <Forms:SubscriptionList/>
            </StackPanel>
        </j:ImageGroupBox>
        <HyperlinkButton Content="Послать сообщение" Click="sendMessage">
            <BaseControl:BaseControl.jBinding>
                <Security:SecurityBinding Permission="UploadMusic"/>
            </BaseControl:BaseControl.jBinding>
        </HyperlinkButton>
        <local:MusicGrid x:Name="grid" HeadersVisibility="Column"/>
    </StackPanel>
    </ScrollViewer>
</BaseControl:DialogControl>
